<html>
    <head>
        <title><?php echo $store_name;?></title>
        <meta charset="UTF-8">
        <meta name="description" content="<?php echo $action['action_name'];?>">
        <meta name="viewport" content="width=device-width, initial-scale=1.0,maximum-scale=1">
        <link href="http://cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet">
        <script type='text/javascript' src='/public/js/jquery-1.11.2.min.js'></script>
        <script type="text/javascript" src='/public/js/jquery.validate.js'></script>
        <script>
            var _hmt = _hmt || [];
            (function () {
                var hm = document.createElement("script");
                hm.src = "//hm.baidu.com/hm.js?8d43b5b5d798921b66d689f7a792e6e2";
                var s = document.getElementsByTagName("script")[0];
                s.parentNode.insertBefore(hm, s);
            })();
        </script>
        <script type="text/javascript">
            document.domain = '<?php echo _DOMAIN_ALL_?>';
        </script>
    </head>
    <body
<div class="container">
    <div class='_main_'>
<link href="http://cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet">
<link href="/public/css/main.css" rel="stylesheet">
        <script type='text/javascript' src='/public/js/jquery-1.11.2.min.js'></script>
        <script type="text/javascript" src='/public/js/jquery.validate.js'></script>
<div style='height:1.5rem'></div>
        <div class="">
            <img src="<?php echo strlen($logo)<1?'/public/images/beijing.jpg':$logo;?>" style='width:100%;min-height:25rem' id='change' alt='banner'/>
        </div>
<div class='_line'></div>
<div  ><?php echo $face['title'] ?>的&nbsp;&nbsp;&nbsp;<span style='font-size:18px;' ><?php echo $face['name'] ?></span></div>
<div class='_line'></div>
<div >
    颜值得分:<span id='score' style='color:red;font-size:18px;' ><?php echo $face['score'] ?></span>分</div>&nbsp;&nbsp;&nbsp;
<div >
    经过系统测评你的分值已经超越了<span style='color:red;font-size:18px;'><?php echo ceil(($percent['num']/$percent['count'])*100); ?>%</span>的活动参与者！大家都为你<span style='color:red;font-size:18px;'><?php echo $emotion;?></span>
</div>
<div style='text-align:center' id='hearts' > <a href="javascript:;"   ><img src="/public/images/heart.png" style='width:20%' id='heart'></a></div>
<div style='font-size:18px;text-align:center' > 点亮红心,助力好友</div>
<div class='_line'></div>
<div style='text-align:center'>分享活动链接到朋友圈邀请朋友助力加成 </div>
<?php  krsort($help); if($help!=''){ ?>
<div> 
	<div>好友评价</div>
    <?php $n=0; foreach($help as $k=>$v){  $n++; if($n==10){ break 1; }?>
    <div style='margin-left:2rem;' ><p id='friend'><span style='font-size:18px;' ><?php echo $v['evaluate'][0] ?></span>为你点赞并<?php echo  mb_substr($v[1],0,9); ?><span style='color:red;font-size:18px;'><?php echo $v['evaluate'][1]; ?></span></p></div>
    <?php } ?>
</div>
<?php } ?>
<div class='_line'></div>
<script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script type="text/javascript">
$(document).ready(function(){
    var path = "<?php $imgs=$face['image']; 
                $_img = explode('/',$imgs);
                $last = array_pop($_img);
                $img[] = 'copy_'.$last;
                $imagename = implode('/',$_img);
                $imagename=$imagename.'/'.$img[0];
                echo $imagename = str_replace('./', '/',$imagename);
                ?>";
    path='http://<?php echo IMAGE_DOMAIN;?>'+path;
    var logo = $('#change').attr('src');
    $('#change').attr('src',path);
    var helped = "<?php echo $helped ?>";
    if(helped==1){ 
        $('#hearts').html('');
        var html ='<img src="/public/images/mheart.png" style="width:20%"  >';
        $('#hearts').append(html);
    }
    var d="<?php echo $_GET['d']?>";
        if(d==2){
            alert('领取失败！');
        }
        if(d==3){
            alert('您已领取过该优惠劵！');
        }
        if(d==1){
            alert('验证码错误！');
        }
        if(d==4){
            alert('该优惠劵已领完！');
        }
        /*if(d==5){
            alert('领取成功！');
        } */

$("#heart").click(function(){
    var paths ="/public/images/mheart.png";
    $('#coupon').show();
    $('#heart').attr('src',paths);
    
    var num = "<?php echo rand(3,5) ?>";
    var nums = $('#score').html();
    num = Number(num)+ Number(nums);
    $.ajax({url: "/user/action/updateFace?store_id=<?php echo $store['id'] ?>&id=<?php echo $face['id'] ?>&action_id=<?php echo $face['action_id'] ?>&name=<?php echo $name ?>&score="+num, async: true, success: function (msg) {
                if (msg == 'false') {
                    alert(msg);
                    return false;
                }
               
                    $.ajax({url:"http://<?php echo IMAGE_DOMAIN; ?>/water.php?img=<?php echo $face['image']?>&num="+msg,async: true,
                     success: function(msg){
                            if(msg == 'true'){
                                alert('yes');
                            }else{
                                alert('error');
                            }

                    } });
                    $('#score').html(num);
                
            }
        });
 });
 $("#change").click(function(){
    $('#show').show();
 });
 $('#closeq').click(function(){
    $('#show').hide();
 });
 $("#code").click(function(){
    $('#showCode').show();
 });
 $("#closeC").click(function(){
    $('#showCode').hide();
 });
 $("#closeE").click(function(){
    $('#coupon').hide();
 });
 $('#enter').click(function(){
    window.location.href="/user/action/info?store_id=<?php echo $store['id'] ?>&aid=<?php echo $face['action_id'] ?>"
 });
 $('#subcode').click(function(){
        var mobile = $("#mobile").val();
        $.ajax({url: "/user/barber/code?mobile=" + mobile, async: true, success: function (msg) {
                if (msg != 'true') {
                    alert(msg);
                    return false;
                }
                $("#subcode").text('60');
                $("#subcode").attr('disabled', 'disabled');
                var t = setInterval(function () {
                    var m = $("#subcode").text();
                    var str = parseInt(m) - 1;
                    if (str <= 0) {
                        str = '获取验证码';
                        $("#subcode").removeAttr('disabled');
                        clearInterval(t);
                    }
                    $("#subcode").text(str);
                }, 1000);
            }
        });
    });

var _mobile = /^(((1[1-9]{1}[0-9]{1})|(15[0-9]{1}))+\d{8})$/
        $("#cou").click(function(){
            document.getElementsByTagName('body')[0].scrollTop=document.getElementsByTagName('body')[0].scrollHeight;
            var mobile = $("#mobile").val();
            if(!_mobile.test(mobile)){
                alert('请先填写手机号');
                return false;
            }
            $('#form').submit();
        });

  });
 <?php if($weixin == true){?>
    wx.config({
        debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
        appId: '<?php echo  WEIXIN_PAY_APP_ID;?>', // 必填，公众号的唯一标识
        timestamp: '<?php echo $data["timestamp"];?>', // 必填，生成签名的时间戳
        nonceStr: '<?php echo $data["noncestr"];?>', // 必填，生成签名的随机串
        signature: '<?php echo $data["sign"];?>',// 必填，签名，见附录1
        jsApiList: ['onMenuShareTimeline','onMenuShareAppMessage'] // 必填，需要使用的JS接口列表，所有JS接口列表见附录2
    });
    wx.ready(function () {
        wx.onMenuShareTimeline({
            title: '<?php echo $face["name"] ;?>', // 分享标题
            link: '<?php echo $data["url"];?>', // 分享链接
            imgUrl: '<?php echo "http://".MAIN_DOMAIN.$face["image"];?>', // 分享图标
            success: function () { 
                

            },
            cancel: function () { 
                // 用户取消分享后执行的回调函数

            }
        });
        wx.onMenuShareAppMessage({
            title: '<?php echo $face["name"];?>', // 分享标题
            desc: '<?php echo $face["intro"];?>', // 分享描述
            link: '<?php echo $data["url"];?>', // 分享链接
            imgUrl: '<?php echo "http://".MAIN_DOMAIN.$face["image"];?>', // 分享图标
            type: '', // 分享类型,music、video或link，不填默认为link
            dataUrl: '', // 如果type是music或video，则要提供数据链接，默认为空
            success: function () { 
                // 用户确认分享后执行的回调函数

            },
            cancel: function () { 
                // 用户取消分享后执行的回调函数

            }
        });
    });
<?php }?>
</script>
<div id='show' style="text-align:center;width:100%;height:100%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#8E8E8E',endColorstr='##8E8E8E');
    background-color:rgba(0, 0, 0, 1.0);position:fixed; _position:absolute; top:0;left:0; z-index:5000;display:none ">
    <?php if(strlen($face['image'])>0){ ?>
    <div style="padding-top:1rem;">
    <img src="<?php $imagename = str_replace('', '',$face['image']); echo 'http://'.IMAGE_DOMAIN.$face['image'];?>" style='width:30rem;'>
    </div>
    <div class='_line'></div>
    <a href='javascript:;' id='closeq' ><font style="font-size: 3rem;color:white"><b>关闭</b></font></a>
    <?php }?>
</div>


<div id='coupon' style="text-align:center;width:100%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#8E8E8E',endColorstr='##8E8E8E');
    background-color:rgba(225, 225,225, 1.0);position:fixed; _position:absolute; top:0;left:0; z-index:5000;display:none ">
    <div class="banner" style='margin:0.5rem;'>

            <?php if(strlen($logo)<1){ ?>
            <div class='_logo' style='height: 25rem'>
                <a href='/'><img src="/public/images/logo.jpeg" class='logo_img'  alt='banner'/></a>
            </div>
            <?php } ?>
            <img src="<?php echo strlen($logo)<1?'/public/images/beijing.jpg':$logo;?>" class='banner_img'  alt='banner'/>
            <div  style='margin-top:-30rem;margin-left:-72rem'><a href='javascript:;' id='closeE' ><img src="/public/images/error.jpg" width='20rem' height='20rem'></a></div>
    </div>
    <div class='_line'></div>
    <div style='margin-top:-5rem;margin-left:-2rem'> <img id='code' src="<?php echo $store['code'];?>" style='width:8rem;height:8rem'> <span >识别图中二维码,查看你的评分称号</span></div>
    <div class='_line'></div>
    <div style='text-align:center;font-size:20px;margin-left:2rem;margin-right:2rem'>您已成功点亮红心,<span style='color:red;'><?php echo $name?></span>为您送上一份感谢礼物-<?php echo $store['name']?>&nbsp;&nbsp;<span style='color:red;'><?php  echo $coupon['content'],$coupon['type_name']?></span>一张</div>
    <div class='_line'></div> 
    <form id="form" action="/user/action/coupon?store_id=<?php echo $store['id'] ?>" method="post" >
    <div class='box'>
    <input style="width:90%;height:3rem" type="text" value="" id="mobile" name='mobile' placeholder="请填写手机号"/>
    </div>
        <div class='_line'></div>
    <div class='box'>
    <input  type='hidden' name='id' value="<?php echo $face['id'] ?>" >
    <input  type='hidden' name='coupon_id' value="<?php echo $coupon['id'] ?>" >        
    <input style='width:55%;height:3rem' type="text" value="" id="_code" name='code' placeholder="请填验证码">
    &nbsp;&nbsp;&nbsp;<button type="button" id='subcode'  style='width:30%'>获取验证码</button>
    </div>
    <div class='_line'></div>
    <div  style="text-align: center;">
        <button class="btn btn-primary btn-lg" id='cou' type="button" style="width:45%;background-color:#FF79BC;border-color:white">我要领取</button>
        <button class="btn btn-primary btn-lg" id='enter' type="button" style="width:45%;background-color:#FF79BC;border-color:white">我要参加</button>
    </div>
    <div class='_line'></div>
</div>
<div id='showCode' style="text-align:center;width:100%;height:100%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#8E8E8E',endColorstr='##8E8E8E');
    background-color:rgba(225, 225,225, 1.0);position:fixed; _position:absolute; top:0;left:0; z-index:5000;display:none "> 
    <div style="padding-top:10rem">
    <img src="<?php echo $store['code'];?>" style='width:30rem;height:30rem'>
    </div>
    <div class='_line'></div>
    <a href='javascript:;' id='closeC' ><font style="font-size: 3rem;color:black"><b>关闭</b></font></a>
</div>
</div>
</div>
</body></html>
